<?php

class Sistema_Form_Osistema extends Zend_Form
{

    public function init()
    {
        $front = Zend_Controller_Front::getInstance();
        $controller = $front->getRequest()->getControllerName();
        $module = $front->getRequest()->getModuleName();
        $url = $front->getBaseUrl().'/'.$module.'/'.$controller;
        
        $this->setName('form');
        
        $el = new Zend_Form_Element_Hidden('SIS_ID',array('disableLoadDefaultDecorators' =>true));
        $el->addDecorators(array(array('ViewHelper'),array('Errors')))
            ->addFilter('Int');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('SIS_NOM');
        $el->setLabel('Nome');
        $el->setRequired(true);
        $el->setAttrib('required', '');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Textarea('SIS_TXT');
        $el->setLabel('Texto');
        $el->setRequired(true);
        $el->setAttrib('required', '');
        $this->addElement($el);
                 
        $el = new Zend_Form_Element_Textarea('SIS_LNKVID');
        $el->setLabel('link Vídeo');
        //$el->setRequired(true);
        //$el->setAttrib('required', '');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_File('SIS_FILE');
        $el->setLabel('Vídeo');
        $this->addElement($el);

        $el = new Zend_Form_Element_Checkbox('SIS_STA',array('checked'=>'checked'));
        $el->setLabel('Ativo');
        $this->addElement($el);
        
        $btn = new Zend_Form_Element_Submit('Salvar',array('disableLoadDefaultDecorators' =>true));
        $btn->addDecorators(array(array('ViewHelper'),array('Errors')));
        $btn->setAttrib('id', 'submitbutton');
        $btn->setAttrib('class', 'btn-frm');
        $this->addElement($btn);
        
        $btn = new Zend_Form_Element_Button('Cancelar',array('disableLoadDefaultDecorators' =>true));
        //$btn->addDecorators(array(array('ViewHelper'),array('Errors')));
        $btn->setDecorators(array(array('Description', array('escape' => false, 'tag' => false))));
        $btn->setDescription('<a href="'.$url.'" class="btn-frm">Cancelar</a>');
        $btn->setAttrib('id', 'btncancel');
        $btn->setAttrib('class', 'btn-frm');
        $this->addElement($btn);
     
    }


}

